-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add builder for keeping track of references found #76
Conversation
// If flag is in both added and removed then it is being modified | ||
delete(flagsRef.FlagsRemoved, flagKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deduping "modified" flags now happens in Build()
@@ -131,9 +131,7 @@ func ProcessFlags(flagsRef lflags.FlagsRef, flags []ldapi.FeatureFlag, config *l | |||
// sort keys so hashing can work for checking if comment already exists | |||
sort.Strings(addedKeys) | |||
for _, flagKey := range addedKeys { | |||
// If flag is in both added and removed then it is being modified | |||
delete(flagsRef.FlagsRemoved, flagKey) | |||
flagAliases := uniqueAliases(flagsRef.FlagsAdded[flagKey]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove duplicate or empty alias strings is now handled by Build()
LaunchDarkly flag references🔍 2 flags added or modified
❌ 1 flag removed
|
flagMap[op][flagKey][alias] = true | ||
} | ||
} | ||
aliasMatches := elementMatcher.FindAliases(line, flagKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was always supposed to be calling elementMatcher.FindAliases
- since we don't have monorepo support, it hasn't mattered so far that it wasn't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
Moves a lot logic out of
ProcessDiffs
by using a builder to track references.This allows us to use
Build()
to do additional processing that other functions were doing (like deduping added/removed flags as "modified").This sets us up to handle monorepo support a lot more easily.